package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);not null;index:ip_idx"`
	Password string `gorm:"type:varchar(34);not null;index:ip_idx"`
}
type RealName_user struct {
	gorm.Model
	UserId   int64  `gorm:"type:int(10);not null;index:ip_idx"`
	RealName string `gorm:"type:varchar(20);not null;index:ip_idx"`
	IdCard   string `gorm:"type:char(18);not null;index:ip_idx"`
}

func (u *RealName_user) Create() error {
	return DB.Create(&u).Error
}
func (u *RealName_user) GetUser(userId int64, idCard string) error {
	return DB.Where("user_id=? or id_card=?", userId, idCard).Find(&u).Error
}
